package videowarehouseapp;

import java.io.Serializable;
import java.sql.Timestamp;import videostoreapp.Order.OrderInfo;
;

public interface Delivery {

    /**
     * A delivery request
     *
     */
    public class DeliveryInfo implements Serializable
    {
        public int id;	            // unique identifier for this delivery request
        public int orderId;	        // which order
        public String warehouse;	// warehouse handling this order
        public Timestamp deliveryDate;	// when order was shipped
        public int status;	        // status of delivery

        public DeliveryInfo(int id, int orderId, String warehouse, Timestamp deliveryDate, int status)
        {
            this.id = id;
            this.orderId = orderId;
            this.warehouse = warehouse;
            this.deliveryDate = deliveryDate;
            this.status = status;
        }
    }
    
    /**
     *  Creates a delivery record and returns its id
     * @param delivery
     * @return -1 if a Delivery record creation failed
     */
    public int createDelivery(OrderInfo delivery);

    /**
     *  Modify delivery record attributes. 
     * @param delivery
     */
    public void modifyDelivery(DeliveryInfo delivery);

    /**
     *  Deletes a delivery record by its id
     * @param id
     */
    public void deleteDelivery(int id);

    /**
     * Submit a delivery request for processing
     * @param id
     */
    public void submitDelivery(int id) throws ApplicationException;

    /**
     *  Returns a delivery record by its id
     * @param id
     * @return return null if record is not found
     */
    public DeliveryInfo getDeliveryById(int id);
}
